/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package presentation.view;

import java.util.Date;
import javax.swing.*;

/**
 *
 * @author Joanna 8a
 */
public class FramePrincipal extends javax.swing.JFrame {

    /**
     * Creates new form FramePrincipal
     */
    public FramePrincipal() {
        initComponents();
        setTitle("Proyect Stunnicus [r1]");
        setIconImage(new ImageIcon(getClass().getResource("/presentation/view/images/pin.png")).getImage());
        controlBarraHerramientas(false);
        this.cambiarPanel(new PanelLogin(this));

    }

    public void controlBarraHerramientas(boolean habilitar) {
        jMenuBar1.setVisible(habilitar);
        this.setResizable(habilitar);
    }

    public void cambiarPanel(JPanel panel) {
        jPanel_Principal.setVisible(false);
        jPanel_Principal.removeAll();
        jPanel_Principal.add(panel);
        jPanel_Principal.setSize(panel.getPreferredSize());
        jPanel_Principal.setVisible(true);
        this.setSize(this.getPreferredSize());
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel_Principal = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        busquedaTareas = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jInternalFrameProyectos = new javax.swing.JInternalFrame();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTreeProjects = new javax.swing.JTree();
        jButton1 = new javax.swing.JButton();
        addProject = new javax.swing.JButton();
        jCalendar1 = new com.toedter.calendar.JCalendar();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jDateChooser1 = new com.toedter.calendar.JDateChooser();
        jLabel3 = new javax.swing.JLabel();
        timeSpinner1 = new javax.swing.JSpinner();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu_MiCuenta = new javax.swing.JMenu();
        jMenuItem_VerCuenta = new javax.swing.JMenuItem();
        jMenuItem_ModificarCuenta = new javax.swing.JMenuItem();
        jMenuItem_EliminarCuenta = new javax.swing.JMenuItem();
        jMenuItem_CerrarSesion = new javax.swing.JMenuItem();
        jMenuItemSalir = new javax.swing.JMenuItem();
        jMenu_Horario = new javax.swing.JMenu();
        jMenuItem_VerHorario = new javax.swing.JMenuItem();
        jMenuItem_ModificarHorario = new javax.swing.JMenuItem();
        jMenuItem_EliminarHorario = new javax.swing.JMenuItem();
        jMenuItem_NuevoHorario = new javax.swing.JMenuItem();
        jMenu_Notas = new javax.swing.JMenu();
        jMenuItemVerNotas = new javax.swing.JMenuItem();
        jMenuItemModNotas = new javax.swing.JMenuItem();
        jMenu_Contactos = new javax.swing.JMenu();
        jMenuItem_VerContactos = new javax.swing.JMenuItem();
        jMenuItem_ModificarContacto = new javax.swing.JMenuItem();
        jMenuItem_EliminarContacto = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu_Materias = new javax.swing.JMenu();
        jMenuItem_AgregarMateria = new javax.swing.JMenuItem();
        jMenuItem_ModificarMateria = new javax.swing.JMenuItem();
        jMenuItem_EliminarMateria = new javax.swing.JMenuItem();
        jMenuProfesores = new javax.swing.JMenu();
        jMenuItemAñadirProfesor = new javax.swing.JMenuItem();
        jMenuItemModificarProfesor = new javax.swing.JMenuItem();
        jMenuItemEliminarProfesor = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel_Principal.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        busquedaTareas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/search (2).png"))); // NOI18N
        busquedaTareas.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 102), 1, true));

        jInternalFrameProyectos.setResizable(true);
        jInternalFrameProyectos.setTitle("Proyectos");
        jInternalFrameProyectos.setFont(new java.awt.Font("Segoe UI Light", 1, 14)); // NOI18N
        jInternalFrameProyectos.setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/molecule.png"))); // NOI18N
        jInternalFrameProyectos.setVisible(true);
        jInternalFrameProyectos.getContentPane().setLayout(null);

        jScrollPane3.setViewportView(jTreeProjects);

        jInternalFrameProyectos.getContentPane().add(jScrollPane3);
        jScrollPane3.setBounds(0, 0, 210, 170);

        jButton1.setText("Remove");
        jInternalFrameProyectos.getContentPane().add(jButton1);
        jButton1.setBounds(110, 180, 73, 23);

        addProject.setText("Add");
        jInternalFrameProyectos.getContentPane().add(addProject);
        addProject.setBounds(20, 180, 60, 23);

        jScrollPane1.setViewportView(jInternalFrameProyectos);
        try {
            jInternalFrameProyectos.setIcon(true);
        } catch (java.beans.PropertyVetoException e1) {
            e1.printStackTrace();
        }

        jCalendar1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Calendar", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), new java.awt.Color(255, 79, 201))); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
            .addComponent(busquedaTareas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jCalendar1, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(busquedaTareas, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel_Principal.add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 260, 490));

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Tareas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 1, 14), java.awt.Color.darkGray)); // NOI18N

        jScrollPane2.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.pink, java.awt.Color.gray));

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.darkGray, java.awt.Color.orange));

        jLabel1.setText("Nombre");

        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        jLabel2.setText("Fecha");

        jLabel3.setText("Hora");

        JSpinner timeSpinner1 = new JSpinner( new SpinnerDateModel() );
        JSpinner.DateEditor timeEditor = new JSpinner.DateEditor(timeSpinner1, "HH:mm:ss");
        timeSpinner1.setEditor(timeEditor);
        timeSpinner1.setValue(new Date());

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addComponent(jLabel2)
                            .addGap(18, 18, 18)
                            .addComponent(jDateChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(timeSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(23, 23, 23))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(timeSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(96, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 288, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel_Principal.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 10, 250, 480));

        getContentPane().add(jPanel_Principal, java.awt.BorderLayout.CENTER);

        jMenuBar1.setFont(new java.awt.Font("Segoe UI Light", 1, 14)); // NOI18N

        jMenu_MiCuenta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/nuclear.png"))); // NOI18N
        jMenu_MiCuenta.setText("Mi Cuenta");
        jMenu_MiCuenta.setFont(new java.awt.Font("Segoe UI Light", 1, 12)); // NOI18N

        jMenuItem_VerCuenta.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_VerCuenta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/file_text.png"))); // NOI18N
        jMenuItem_VerCuenta.setText("Ver Cuenta");
        jMenuItem_VerCuenta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_VerCuentaActionPerformed(evt);
            }
        });
        jMenu_MiCuenta.add(jMenuItem_VerCuenta);

        jMenuItem_ModificarCuenta.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_ModificarCuenta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/file_edit.png"))); // NOI18N
        jMenuItem_ModificarCuenta.setText("Modificar Cuenta");
        jMenuItem_ModificarCuenta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_ModificarCuentaActionPerformed(evt);
            }
        });
        jMenu_MiCuenta.add(jMenuItem_ModificarCuenta);

        jMenuItem_EliminarCuenta.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_EliminarCuenta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/file_remove.png"))); // NOI18N
        jMenuItem_EliminarCuenta.setText("Eliminar Cuenta");
        jMenuItem_EliminarCuenta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_EliminarCuentaActionPerformed(evt);
            }
        });
        jMenu_MiCuenta.add(jMenuItem_EliminarCuenta);

        jMenuItem_CerrarSesion.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_CerrarSesion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/connect.png"))); // NOI18N
        jMenuItem_CerrarSesion.setText("Cerrar Sesión");
        jMenuItem_CerrarSesion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_CerrarSesionActionPerformed(evt);
            }
        });
        jMenu_MiCuenta.add(jMenuItem_CerrarSesion);

        jMenuItemSalir.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItemSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/close.png"))); // NOI18N
        jMenuItemSalir.setText("Salir");
        jMenuItemSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemSalirActionPerformed(evt);
            }
        });
        jMenu_MiCuenta.add(jMenuItemSalir);

        jMenuBar1.add(jMenu_MiCuenta);

        jMenu_Horario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/calendar_empty.png"))); // NOI18N
        jMenu_Horario.setText("Horario");
        jMenu_Horario.setFont(new java.awt.Font("Segoe UI Light", 1, 12)); // NOI18N

        jMenuItem_VerHorario.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_VerHorario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/search_database.png"))); // NOI18N
        jMenuItem_VerHorario.setText("Ver Horario");
        jMenuItem_VerHorario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_VerHorarioActionPerformed(evt);
            }
        });
        jMenu_Horario.add(jMenuItem_VerHorario);

        jMenuItem_ModificarHorario.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_ModificarHorario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/download_database.png"))); // NOI18N
        jMenuItem_ModificarHorario.setText("Modificar Horario");
        jMenuItem_ModificarHorario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_ModificarHorarioActionPerformed(evt);
            }
        });
        jMenu_Horario.add(jMenuItem_ModificarHorario);

        jMenuItem_EliminarHorario.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_EliminarHorario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/remove_from_database.png"))); // NOI18N
        jMenuItem_EliminarHorario.setText("Eliminar Horario");
        jMenuItem_EliminarHorario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_EliminarHorarioActionPerformed(evt);
            }
        });
        jMenu_Horario.add(jMenuItem_EliminarHorario);

        jMenuItem_NuevoHorario.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_NuevoHorario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/calendar_empty.png"))); // NOI18N
        jMenuItem_NuevoHorario.setText("Crear Nuevo Horario");
        jMenu_Horario.add(jMenuItem_NuevoHorario);

        jMenuBar1.add(jMenu_Horario);

        jMenu_Notas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/canvas_holder.png"))); // NOI18N
        jMenu_Notas.setText("Notas");
        jMenu_Notas.setFont(new java.awt.Font("Segoe UI Light", 1, 12)); // NOI18N

        jMenuItemVerNotas.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItemVerNotas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/search_page.png"))); // NOI18N
        jMenuItemVerNotas.setText("Ver Notas");
        jMenuItemVerNotas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemVerNotasActionPerformed(evt);
            }
        });
        jMenu_Notas.add(jMenuItemVerNotas);

        jMenuItemModNotas.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItemModNotas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/file_edit.png"))); // NOI18N
        jMenuItemModNotas.setText("Modificar Notas");
        jMenuItemModNotas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemModNotasActionPerformed(evt);
            }
        });
        jMenu_Notas.add(jMenuItemModNotas);

        jMenuBar1.add(jMenu_Notas);

        jMenu_Contactos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/users (2).png"))); // NOI18N
        jMenu_Contactos.setText("Contactos");
        jMenu_Contactos.setFont(new java.awt.Font("Segoe UI Light", 1, 12)); // NOI18N

        jMenuItem_VerContactos.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_VerContactos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/users 1.png"))); // NOI18N
        jMenuItem_VerContactos.setText("Ver Contactos");
        jMenuItem_VerContactos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_VerContactosActionPerformed(evt);
            }
        });
        jMenu_Contactos.add(jMenuItem_VerContactos);

        jMenuItem_ModificarContacto.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_ModificarContacto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/edit_profile.png"))); // NOI18N
        jMenuItem_ModificarContacto.setText("Modificar Contacto");
        jMenuItem_ModificarContacto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_ModificarContactoActionPerformed(evt);
            }
        });
        jMenu_Contactos.add(jMenuItem_ModificarContacto);

        jMenuItem_EliminarContacto.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_EliminarContacto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/delete_user.png"))); // NOI18N
        jMenuItem_EliminarContacto.setText("Eliminar Contacto");
        jMenuItem_EliminarContacto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_EliminarContactoActionPerformed(evt);
            }
        });
        jMenu_Contactos.add(jMenuItem_EliminarContacto);

        jMenuItem1.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/user_accept.png"))); // NOI18N
        jMenuItem1.setText("Agregar Contacto");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu_Contactos.add(jMenuItem1);

        jMenuBar1.add(jMenu_Contactos);

        jMenu_Materias.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/office_folders.png"))); // NOI18N
        jMenu_Materias.setText("Materias");
        jMenu_Materias.setFont(new java.awt.Font("Segoe UI Light", 1, 12)); // NOI18N

        jMenuItem_AgregarMateria.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_AgregarMateria.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/add_to_folder.png"))); // NOI18N
        jMenuItem_AgregarMateria.setText("Agregar Materia");
        jMenuItem_AgregarMateria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_AgregarMateriaActionPerformed(evt);
            }
        });
        jMenu_Materias.add(jMenuItem_AgregarMateria);

        jMenuItem_ModificarMateria.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_ModificarMateria.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/file_configuration.png"))); // NOI18N
        jMenuItem_ModificarMateria.setText("Modificar Materia");
        jMenuItem_ModificarMateria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_ModificarMateriaActionPerformed(evt);
            }
        });
        jMenu_Materias.add(jMenuItem_ModificarMateria);

        jMenuItem_EliminarMateria.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItem_EliminarMateria.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/delete_folder.png"))); // NOI18N
        jMenuItem_EliminarMateria.setText("Eliminar Materia");
        jMenuItem_EliminarMateria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem_EliminarMateriaActionPerformed(evt);
            }
        });
        jMenu_Materias.add(jMenuItem_EliminarMateria);

        jMenuBar1.add(jMenu_Materias);

        jMenuProfesores.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/business_user.png"))); // NOI18N
        jMenuProfesores.setText("Profesores");
        jMenuProfesores.setFont(new java.awt.Font("Segoe UI Light", 1, 12)); // NOI18N

        jMenuItemAñadirProfesor.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItemAñadirProfesor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/accept_business_user.png"))); // NOI18N
        jMenuItemAñadirProfesor.setText("Añadir Profesor");
        jMenuItemAñadirProfesor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemAñadirProfesorActionPerformed(evt);
            }
        });
        jMenuProfesores.add(jMenuItemAñadirProfesor);

        jMenuItemModificarProfesor.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItemModificarProfesor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/edit_business_user.png"))); // NOI18N
        jMenuItemModificarProfesor.setText("Modificar Profesor");
        jMenuItemModificarProfesor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemModificarProfesorActionPerformed(evt);
            }
        });
        jMenuProfesores.add(jMenuItemModificarProfesor);

        jMenuItemEliminarProfesor.setFont(new java.awt.Font("Segoe UI Light", 0, 12)); // NOI18N
        jMenuItemEliminarProfesor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentation/view/images/remove_business_user.png"))); // NOI18N
        jMenuItemEliminarProfesor.setText("Eliminar Profesor");
        jMenuItemEliminarProfesor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemEliminarProfesorActionPerformed(evt);
            }
        });
        jMenuProfesores.add(jMenuItemEliminarProfesor);

        jMenuBar1.add(jMenuProfesores);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem_VerCuentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_VerCuentaActionPerformed
        String verCuenta = "Ver Cuenta";
        cambiarPanel(new PanelMiCuenta(false, verCuenta, this));
    }//GEN-LAST:event_jMenuItem_VerCuentaActionPerformed

    private void jMenuItem_VerHorarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_VerHorarioActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelHorario(1));
    }//GEN-LAST:event_jMenuItem_VerHorarioActionPerformed

    private void jMenuItem_ModificarContactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_ModificarContactoActionPerformed
        // TODO add your handling code here:
        
        cambiarPanel(new PanelVerContactos(2));
        
    }//GEN-LAST:event_jMenuItem_ModificarContactoActionPerformed

    private void jMenuItem_AgregarMateriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_AgregarMateriaActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelAñadirMateria());
    }//GEN-LAST:event_jMenuItem_AgregarMateriaActionPerformed

    private void jMenuItem_EliminarHorarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_EliminarHorarioActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelHorario(3));
    }//GEN-LAST:event_jMenuItem_EliminarHorarioActionPerformed

    private void jMenuItem_ModificarCuentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_ModificarCuentaActionPerformed
        cambiarPanel(new PanelRegistro(this, "Modificar"));
    }//GEN-LAST:event_jMenuItem_ModificarCuentaActionPerformed

    private void jMenuItem_EliminarCuentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_EliminarCuentaActionPerformed
        // TODO add your handling code here:
        String elimCuenta = "Eliminar Cuenta";
        cambiarPanel(new PanelMiCuenta(false, elimCuenta, this));
    }//GEN-LAST:event_jMenuItem_EliminarCuentaActionPerformed

    private void jMenuItemSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSalirActionPerformed
        vo.AlumnoVO al = new presentation.controller.ControlPanelMiCuenta().FindByIp();
        al.setUsuarioActivo(new presentation.controller.ControlPanelRegistro().ColocarIpUsuario());
        new presentation.controller.ControlPanelRegistro().ModificarAlumno(al, al.getPassword());
        System.exit(0);
    }//GEN-LAST:event_jMenuItemSalirActionPerformed

    private void jMenuItem_ModificarMateriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_ModificarMateriaActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelModificarMateria(2));
    }//GEN-LAST:event_jMenuItem_ModificarMateriaActionPerformed

    private void jMenuItem_EliminarMateriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_EliminarMateriaActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelModificarMateria(1));
    }//GEN-LAST:event_jMenuItem_EliminarMateriaActionPerformed

    private void jMenuItem_VerContactosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_VerContactosActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelVerContactos(1));
    }//GEN-LAST:event_jMenuItem_VerContactosActionPerformed

    private void jMenuItemVerNotasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemVerNotasActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelCalificaciones(true));
    }//GEN-LAST:event_jMenuItemVerNotasActionPerformed

    private void jMenuItemModNotasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemModNotasActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelCalificaciones(false));
    }//GEN-LAST:event_jMenuItemModNotasActionPerformed

    private void jMenuItem_EliminarContactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_EliminarContactoActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelVerContactos(3));
    }//GEN-LAST:event_jMenuItem_EliminarContactoActionPerformed

    private void jMenuItemAñadirProfesorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAñadirProfesorActionPerformed
    //jPanel_Principal.setVisible(false);
    //jPanel_Principal.removeAll();
    FrameAñadirProfesor frameAñPr=new FrameAñadirProfesor();
    frameAñPr.setLocationRelativeTo(this);
    frameAñPr.setVisible(true);
    }//GEN-LAST:event_jMenuItemAñadirProfesorActionPerformed

    private void jMenuItemModificarProfesorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemModificarProfesorActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelModificarProfesor(1));
    }//GEN-LAST:event_jMenuItemModificarProfesorActionPerformed

    private void jMenuItemEliminarProfesorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemEliminarProfesorActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelModificarProfesor(2));
    }//GEN-LAST:event_jMenuItemEliminarProfesorActionPerformed

    private void jMenuItem_ModificarHorarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_ModificarHorarioActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelHorario(2));
    }//GEN-LAST:event_jMenuItem_ModificarHorarioActionPerformed

    private void jMenuItem_CerrarSesionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_CerrarSesionActionPerformed
        vo.AlumnoVO al = new presentation.controller.ControlPanelMiCuenta().FindByIp();
        al.setUsuarioActivo(new presentation.controller.ControlPanelRegistro().ColocarIpUsuario());
        new presentation.controller.ControlPanelRegistro().ModificarAlumno(al, al.getPassword());
        JOptionPane.showMessageDialog(this,
                "Sesión cerrada con éxito.");
        
        cambiarPanel(new PanelLogin(this));
        
        //codigo para la sesion
        
        controlBarraHerramientas(false);
    }//GEN-LAST:event_jMenuItem_CerrarSesionActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        cambiarPanel(new PanelAgregarContacto());
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FramePrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FramePrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FramePrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FramePrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                FramePrincipal fp = new FramePrincipal();
                fp.setLocationRelativeTo(null);
                fp.setVisible(true);
            }
        });
    }

    public JMenuBar getjMenuBar1() {
        return jMenuBar1;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addProject;
    private javax.swing.JLabel busquedaTareas;
    private javax.swing.JButton jButton1;
    private com.toedter.calendar.JCalendar jCalendar1;
    private com.toedter.calendar.JDateChooser jDateChooser1;
    private javax.swing.JInternalFrame jInternalFrameProyectos;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItemAñadirProfesor;
    private javax.swing.JMenuItem jMenuItemEliminarProfesor;
    private javax.swing.JMenuItem jMenuItemModNotas;
    private javax.swing.JMenuItem jMenuItemModificarProfesor;
    private javax.swing.JMenuItem jMenuItemSalir;
    private javax.swing.JMenuItem jMenuItemVerNotas;
    private javax.swing.JMenuItem jMenuItem_AgregarMateria;
    private javax.swing.JMenuItem jMenuItem_CerrarSesion;
    private javax.swing.JMenuItem jMenuItem_EliminarContacto;
    private javax.swing.JMenuItem jMenuItem_EliminarCuenta;
    private javax.swing.JMenuItem jMenuItem_EliminarHorario;
    private javax.swing.JMenuItem jMenuItem_EliminarMateria;
    private javax.swing.JMenuItem jMenuItem_ModificarContacto;
    private javax.swing.JMenuItem jMenuItem_ModificarCuenta;
    private javax.swing.JMenuItem jMenuItem_ModificarHorario;
    private javax.swing.JMenuItem jMenuItem_ModificarMateria;
    private javax.swing.JMenuItem jMenuItem_NuevoHorario;
    private javax.swing.JMenuItem jMenuItem_VerContactos;
    private javax.swing.JMenuItem jMenuItem_VerCuenta;
    private javax.swing.JMenuItem jMenuItem_VerHorario;
    private javax.swing.JMenu jMenuProfesores;
    private javax.swing.JMenu jMenu_Contactos;
    private javax.swing.JMenu jMenu_Horario;
    private javax.swing.JMenu jMenu_Materias;
    private javax.swing.JMenu jMenu_MiCuenta;
    private javax.swing.JMenu jMenu_Notas;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel_Principal;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTree jTreeProjects;
    private javax.swing.JSpinner timeSpinner1;
    // End of variables declaration//GEN-END:variables
}
